package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.AssessType;
import com.ruoyi.system.mapper.AssessTypeMapper;
import com.ruoyi.system.service.IAssessTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AssessTypeServiceImpl implements IAssessTypeService {

    @Autowired
    private AssessTypeMapper assessTypeMapper;
//增加
    @Override
    public int insertAssessType(AssessType assessType) {

        assessType.setType(assessType.getType());
        assessType.setDelFlag(0);
        int i = assessTypeMapper.insert(assessType);
        return i;
    }
//展示列表
    @Override
    public List<AssessType> selectAssessTypeList() {
        return assessTypeMapper.selectAssessTypeList();
    }

    @Override
    public int updateAssessType(AssessType assessType) {
        assessType.setDelFlag(0);
        int i = assessTypeMapper.updateByPrimaryKey(assessType);
        return i;
    }

    @Override
    public int deleteAssessType(int id) {
        AssessType assessType = new AssessType();

        assessType.setId(id);
        assessType.setDelFlag(2);
        int i = assessTypeMapper.updateByPrimaryKeySelective(assessType);
        return i;
    }
}
